@font-face {
  font-family: 'ClassicalChinese';
  src: url('https://fonts.googleapis.com/css2?family=Ma+Shan+Zheng&display=swap');
}

.personal-container {
  width: 100%;
  min-height: 100vh;
  background-image: url('../img/background.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  box-sizing: border-box;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  overflow: auto;
}

/* 导航栏样式 */
.nav-bar {
  width: 100%;
  height: 60px;
  background-color: rgba(255, 255, 255, 0.9);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-links {
  display: flex;
  gap: 30px;
}

.nav-item {
  font-family: 'ClassicalChinese', 'Ma Shan Zheng', serif;
  font-size: 1.2rem;
  color: #8B4513;
  cursor: pointer;
  transition: color 0.3s;
}

.nav-item:hover {
  color: #5D4037;
  text-decoration: underline;
}

.nav-item.active {
  color: #5D4037;
  font-weight: bold;
  text-decoration: underline;
}

.user-section {
  position: relative;
}

.user-avatar {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid #8B4513;
  background-color: #f0e6d2;
  transition: transform 0.2s, box-shadow 0.2s;
}

.user-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 0 8px rgba(139, 69, 19, 0.6);
}

.user-avatar:active {
  transform: scale(0.95);
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.8rem;
  color: #8B4513;
  font-weight: bold;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login-dropdown {
  position: absolute;
  top: 50px;
  right: 0;
  background-color: white;
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  padding: 10px;
  z-index: 1000;
  min-width: 100px;
  animation: dropdownFadeIn 0.2s;
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-dropdown button {
  background-color: #8B4513;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'ClassicalChinese', 'Ma Shan Zheng', serif;
  width: 100%;
  white-space: nowrap;
}

.login-dropdown button:hover {
  background-color: #6D351A;
}

.content {
  width: 90%;
  max-width: 1000px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.9);
  padding: 40px;
  border-radius: 15px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  margin-top: 30px;
  margin-bottom: 30px;
  position: relative;
  overflow: hidden;
}

.content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(to right, #8B4513, #D2B48C);
}

.title {
  font-family: 'ClassicalChinese', 'Ma Shan Zheng', serif;
  font-size: 2.5rem;
  color: #8B4513;
  margin-bottom: 40px;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
  position: relative;
  padding-bottom: 15px;
}

.title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background-color: #8B4513;
  border-radius: 3px;
}

.user-form {
  width: 100%;
  max-width: 800px;
  background-color: rgba(255, 255, 255, 0.7);
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(210, 180, 140, 0.3);
}

.form-row {
  display: flex;
  gap: 30px;
  margin-bottom: 25px;
}

.form-group {
  flex: 1;
  position: relative;
  max-width: calc(50% - 15px); /* 添加最大宽度限制 */
}

.form-group.full-width {
  flex: 2;
  max-width: 100%; /* 全宽的输入框可以占满整行 */
}

.form-group label {
  display: block;
  font-family: 'ClassicalChinese', 'Ma Shan Zheng', serif;
  font-size: 1.1rem;
  color: #5D4037;
  margin-bottom: 10px;
  font-weight: 500;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid #d1c4b0;
  border-radius: 8px;
  font-size: 1rem;
  color: #333;
  background-color: rgba(255, 255, 255, 0.9);
  transition: all 0.3s ease;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
  box-sizing: border-box; /* 确保padding不会增加元素的总宽度 */
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #8B4513;
  box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.2);
  transform: translateY(-2px);
}

.form-group input[readonly] {
  background-color: #f8f5f0;
  cursor: not-allowed;
  border-style: dashed;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(210, 180, 140, 0.3);
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-family: 'ClassicalChinese', 'Ma Shan Zheng', serif;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 500;
  letter-spacing: 1px;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 7px 14px rgba(0, 0, 0, 0.1);
}

.btn:active {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.btn-back {
  background-color: #f0e6d2;
  color: #8B4513;
  border: 2px solid #d1c4b0;
}

.btn-back:hover {
  background-color: #e6d8c0;
  border-color: #c0a58a;
}

.btn-reset {
  background-color: #FF9800;
  color: white;
  position: relative;
  overflow: hidden;
}

.btn-reset:hover {
  background-color: #F57C00;
}

.btn-update {
  background-color: #8B4513;
  color: white;
  position: relative;
  overflow: hidden;
}

.btn-update:hover {
  background-color: #6D351A;
}

.btn-reset::after,
.btn-update::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%);
  transform-origin: 50% 50%;
}

.btn-reset:focus::after,
.btn-update:focus::after {
  animation: ripple 1s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 0.5;
  }
  20% {
    transform: scale(25, 25);
    opacity: 0.3;
  }
  100% {
    opacity: 0;
    transform: scale(40, 40);
  }
}

@media (max-width: 768px) {
  .form-row {
    flex-direction: column;
    gap: 20px;
  }
  
  .content {
    padding: 30px 20px;
  }
  
  .title {
    font-size: 2rem;
  }
  
  .user-form {
    padding: 20px;
  }
}